package com.digua.baseiot.config

import com.digua.base.config.BaseConfig
import com.digua.baseiot.BuildConfig
import java.io.File

object Config {

    //接口文档地址：http://47.111.168.254:19998/swagger-ui/index.html
    var apiUrl = BuildConfig.apiUrl

    //检测版本更新
    val checkVersionUrl = "https://update.ndxvs.com/api/build.merchant.Version/index"
    val planSellRatio = 5000

    //友盟名称
    const val umengKey = "65850245a7208a5af18cf2c5"

    //保存文件目录地址
    val fileSavePath: String = File(BaseConfig.APP_SD_PATH.replace(BaseConfig.APP_NAME, "DrLogistics/${BuildConfig.appName}"), "file/").absolutePath
    val imgSavePath: String = File(fileSavePath, "img").absolutePath
    val downloadPath: String = File(fileSavePath, "download").absolutePath

    // ======================== API start ===============================
    //POST 账户密码登录
    fun login() = "system/h5/login"

    //POST 文件上传
    fun uploadFile() = "common/uploadFile"

    //POST 添加图片
    fun addImg() = "system/h5/addImg"

    //GET 揽收
    fun collect(docId: Int, ewbNo: String) = "system/h5/collect/$docId/$ewbNo"

    //GET 揽收明细
    fun collectDetail(customId: Int, pageNum: Int, pageSize: Int = 10) = "system/h5/collectDetail/${customId}?pageNum=${pageNum}&pageSize=$pageSize"

    //GET 揽收查询
    fun collectSearch(siteCode: String) = "system/h5/collectSearch/$siteCode"

    //POST 删除图片
    fun delImg(imgId: Int) = "system/h5/delImg/$imgId"

    //POST 运单修改
    fun ewbModify() = "system/h5/ewbModify"

    //POST 运单查询
    fun ewbSearch() = "system/h5/ewbSearch"

    // ======================== API start ===============================
}